#!/bin/sh
# --------------------------------------------------------------------------
# OpenPanel - The Open Source Control Panel
# Copyright (c) 2006-2007 PanelSix
#
# This software and its source code are subject to version 2 of the
# GNU General Public License. Please be aware that use of the OpenPanel
# and PanelSix trademarks and the IconBase.com iconset may be subject
# to additional restrictions. For more information on these restrictions
# and for a copy of version 2 of the GNU General Public License, please
# visit the Legal and Privacy Information section of the OpenPanel
# website on http:#www.openpanel.com/
# --------------------------------------------------------------------------
if [ ! -d /etc/postfix ]; then
  echo "Postfix missing"
  echo "quit" >&3
  exit 1
fi


PATH=$PATH:/usr/sbin  # for postconf, just to be sure

postconf -h smtpd_recipient_restrictions | grep -wq 'check_recipient_access hash:/etc/postfix/openpanel/amavis/access' || {
  echo "smtpd_recipient_restrictions incomplete"
  echo "quit" >&3
  exit 1
}

postconf -h content_filter | grep . && {
  echo "global content_filter specified, please disable"
  echo "quit" >&3
  exit 1
}

exit 0
